home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / packet / tf27bsrc / l2v.c < prev    next >
C/C++ Source or Header  |  1994-08-29  |  9KB  |  134 lines

  1. /**************************************************************************\
  2. *                                                                          *
  3. *                                                                          *
  4. *    *****                      *****                                      *
  5. *      *****                  *****                                        *
  6. *        *****              *****                                          *
  7. *          *****          *****                                            *
  8. *            *****      *****                                              *
  9. *              *****  *****                                                *
  10. *            *****      *****                                              *
  11. *          *****          *****          The Firmware.                     *
  12. *        *****              *****        Portable. Compatible.             *
  13. *      *****                  *****      Public Domain.                    *
  14. *    *****                      *****    By NORD><LINK.                    *
  15. *                                                                          *
  16. *                                                                          *
  17. *                                                                          *
  18. *    L2V.C   -   Level 2, globale Variable                                 *
  19. *                                                                          *
  20. *    angelegt:      DC4OX                                                  *
  21. *    modifiziert:   DL8ZAW, 25.04.91                                       *
  22. *                   Globale Variable damaok = 1, wenn DAMA-Master erkannt  *
  23. *                                           = 0, wenn kein DAMA-Master     *
  24. *                                                                          *
  25. *                   DL8ZAW, 27.04.91                                       *
  26. *                   Variablen fuer RTT-Messung: A1par, A2par, Bpar, Fpar   *
  27. *                                                                          *
  28. *                   DL8ZAW, 04.05.91                                       *
  29. *                   DAMA-Timer - Startwert: DApar in Sekunden              *
  30. *                                                                          *
  31. *                   DL8ZAW, 18.05.91                                       *
  32. *                   Bpar ist nun A3par!                                    *
  33. *                                                                          *
  34. *                   DB2OS,  28.08.91                                       *
  35. *                   Variable startx gibt es nicht mehr!                    *
  36. *                                                                          *
  37. *                   DL8ZAW, 27.03.92                                       *
  38. *                   istraf[L2PNUM] entfernt, weil nicht benoetigt.         *
  39. *                                                                          *
  40. *                   DB2OS, 12.08.94                                        *
  41. *                   Variablen A1par und A2par entfernt.                    *
  42. *                                                                          *
  43. *                   DB2OS, 28.08.94                                        *
  44. *                   alias[] entfernt.                                      *
  45. \**************************************************************************/
  46.  
  47.  
  48.  
  49.  
  50.  
  51. /*                                                             Includes   */
  52. /**************************************************************************/
  53.  
  54. #include "all.h"         /* allgemeine Festlegungen                       */
  55. #include "l2.h"          /* Festlegungen/Datenstrukturen fuer den Level 2 */
  56.  
  57.  
  58.  
  59.  
  60.  
  61. /*                                                              Globals   */
  62. /**************************************************************************/
  63.  
  64. char        myid[L2IDLEN];    /* Call (normal) + SSID (1 Bit linksgesch.) */
  65.  
  66. char        nmblks;           /* Anzahl aktiver Level-2-Links (1..127)    */
  67. char        aktlks;           /* FEF Anzahl Links mit Status > L2SIXFER   */
  68. char        Ypar;             /* Anzahl moeglicher Links (Y-Befehl)       */
  69. char        damaok;           /* DAMA Betrieb ( 1 = ja, 0 = nein )        */
  70. char        sendok;           /* DAMA Betrieb ( 1 = senden erlaubt )      */
  71. char        tosend;           /* DAMA Betrieb ( 1 = was zu senden da)     */
  72. unsigned    damati;           /* DAMA Timer   ( 1 sec Downcounter)        */
  73.  
  74.                               /* empfangenes Frame :                      */
  75. char        rxfhdr[L2AFLEN+1];/*   Header (Ziel/Quell/via-Id's), 0-term.  */
  76. char        rxfctl;           /*   Kontrollbyte ohne P/F-Bit              */
  77. char        rxfPF;            /*   V1-Frame: 0                            */
  78.                               /*   V2-Frame: 0x10 = P/F gesetzt, 0 sonst  */
  79. char        rxfV2;            /*   0 = V1-Frame, 1 = V2-Frame             */
  80. char        rxfCR;            /*   V1-Frame: 0                            */
  81.                               /*   V2-Frame: 0x80 = Command-Frame         */
  82.                               /*             0x00 = Response-Frame        */
  83. char        rxfprt;           /*   0 = HDLC-Frame, 1 = Crosslink-Frame    */
  84.  
  85.                               /* zu sendendes Frame :                     */
  86. char        txfhdr[L2AFLEN+1];/*   Header (Ziel/Quell/via-Id's), 0-term.  */
  87. char        txfctl;           /*   Kontrollbyte ohne P/F-Bit              */
  88. char        txfPF;            /*   V1-Frame: 0                            */
  89.                               /*   V2-Frame: 0x10 = P/F gesetzt, 0 sonst  */
  90. char        txfV2;            /*   0 = V1-Frame, 1 = V2-Frame             */
  91. char        txfCR;            /*   V1-Frame: 0                            */
  92.                               /*   V2-Frame: 0x80 = Command-Frame         */
  93.                               /*             0x00 = Response-Frame        */
  94. char        txfprt;           /*   0 = HDLC-Frame, 1 = Crosslink-Frame    */
  95.  
  96. unsigned    Fpar;             /* IRTT       10 ms             F-Befehl    */
  97. unsigned    A3par;            /* Alpha3     1..16             @-A3-Befehl */
  98. unsigned    Ipar;             /* IPOLL      0..256            @-I-Befehl  */
  99. unsigned    Opar;             /* MAXFRAME   0..7              O-Befehl    */
  100. unsigned    Npar;             /* RETRY      0..127            N-Befehl    */
  101. unsigned    T2par;            /* T2         10 ms             @-T2-Befehl */
  102. unsigned    T3par;            /* T3         10 ms             @-T3-Befehl */
  103. unsigned    Rpar;             /* DIGION     0..1              R-Befehl    */
  104.                               /* 1 = Digipeaten ein, 0 = aus              */
  105. unsigned    nmbfre;           /* "number free", Anzahl freier 32-Byte-    */
  106.                               /* Buffer (36 Byte mit Kopf)                */
  107. LHEAD       freel;            /* "free list",                             */
  108.                               /* Listenkopf Freibuffer                    */
  109. LHEAD       rxfl;             /* "rx frame list",                         */
  110.                               /* Listenkopf empfangene Frames             */
  111. LHEAD       stfl;             /* "sent frame list",                       */
  112.                               /* Listenkopf gesendete Frames              */
  113. LHEAD       trfl;             /* "trash frame list",                      */
  114.                               /* Listenkopfe Frames fuer den Muelleimer   */
  115. LHEAD       txl2fl[L2PNUM];   /* "tx level 2 frame list",                 */
  116.                               /* Listenkoepfe (je Port einer) zu sendende */
  117.                               /* Frames                                   */
  118. MBHEAD     *rxfhd[L2PNUM];    /* "rx frame head",                         */
  119.                               /* Zeiger (je Port einer) auf das gerade    */
  120.                               /* aktuelle Frame waherend Empfang,         */
  121.                               /* 0 = es wird gerade kein Frame empfangen  */
  122. MBHEAD     *txfhd[L2PNUM];    /* "tx frame head",                         */
  123.                               /* Zeiger (je Port einer) auf das gerade    */
  124.                               /* aktuelle Frame waherend Sendung,         */
  125.                               /* 0 = es wird gerade kein Frame gesendet   */
  126. LNKBLK      lnktbl[LINKNMBR]; /* "link table", fuer jeden moeglichen      */
  127.                               /* Level-2-Link ein Eintrag                 */
  128. LNKBLK     *lnkpoi;           /* "link pointer", globaler Zeiger auf den  */
  129.                               /* gerade aktuellen Linkblock (in lnktbl)   */
  130.  
  131.  
  132.  
  133. /* Ende von L2V.C */
  134.